From c191f766e13676ba31ec253385a6f08cd930855c Mon Sep 17 00:00:00 2001 From: robertl Date: Sat, 21 Feb 2009 19:06:26 +0000 Subject: [PATCH] Rework Garmin transparency device matching to work with more devices. From Google. --- jeeps/gpslibusb.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/jeeps/gpslibusb.c b/jeeps/gpslibusb.c index 2075c4b77..3397c2c7b 100644 --- a/jeeps/gpslibusb.c +++ b/jeeps/gpslibusb.c @@ -359,20 +359,17 @@ int garmin_usb_scan(libusb_unit_data *lud, int req_unit_number) struct usb_device *dev; for (dev = bus->devices; dev; dev = dev->next) { - /* Probably too promiscious of a match, but since - * Garmin doesn't document the _proper_ matching, - * we just take the easy way out for now. - * Unfortunatey, blowing on DeviceClass == Mass storage - * doesn't work on CO, at least. + /* + * Exclude Mass Storage devices (CO, OR, Nuvi, etc.) + * from this scan. + * At least on Mac, bDeviceClass isn't + * USB_MASS_STORAGE as it should be (perhaps because + * the storage driver has already bound to it?) so + * we fondle only the proprietary class devices. */ if (dev->descriptor.idVendor == GARMIN_VID && - dev->config) { - switch (dev->descriptor.idProduct) { - case 0x19: // Nuvi; - case 0x2244: // Zumo; - case 0x2295: // CO; - continue; - } + dev->config && + dev->descriptor.bDeviceClass == USB_CLASS_VENDOR_SPEC ) { if (req_unit_number < 0) { garmin_usb_start(dev, lud); /* -- 2.30.2